package com.great.dao;

import com.great.domain.Order;
import com.great.domain.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author huangwenkai
 * @date 2021/10/19 10:24
 */
@Mapper
public interface OrderDao {

    @Select("select * from `order`")//查询所有订单数据
    @Results({
            @Result(column = "order_id",property = "order_id"),
            @Result(column = "product_id",property = "product_id"),
            @Result(column = "num",property = "num"),
            @Result(column = "price",property = "price"),
            @Result(column = "create_time",property = "create_time"),
            @Result(column = "product_id",property = "product",javaType = Product.class,many = @Many(select = "com.great.dao.ProductDao.findproductById"))
    })


    public List<Order> getAllorder();
}
